package learn_effective_java.item_30;

import java.util.HashSet;
import java.util.Set;

public class T1 {

	public static void main(String[] args) {
		Set<String> guys = Set.of("Tom", "Dick", "Harry");
		Set<String> stooges = Set.of("Larry", "Moe", "Curly");
		Set<String> aflCio = union(guys, stooges);
		System.out.println(aflCio);
	}

	// The type parameter list, which declares the type 
	// parameters, goes between a method's modifiers and 
	// its return type.
	public static <E> Set<E> union(Set<E> s1, Set<E> s2) {
		Set<E> result = new HashSet<>(s1);
		result.addAll(s2);
		return result;
	}

}
